package Year22_Month04.day28;

public class 替换空格 {
    public String replaceSpace(String s) {
        StringBuilder myString = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == ' '){
                myString.append("%20");
            }else{
                myString.append(s.charAt(i));
            }
        }
        return myString.toString();
    }
}
